#include "timer.h"
#include <AT89X52.h>
unsigned char ch[8]={0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f};

void Time0In()
{
TH0 = 0x0f0;
TL0 = 0x0ff;
TMOD = 0x01;
TCON = 0x10;
IE = 0x82;
}
unsigned char Tcount=0;

void Time0_over()  interrupt 1
{
/*Add Interrupt Service Code*/
Tcount++;
TH0 = 0xf0;
TL0 = 0x0;
}

void ding()
{   Tcount++;
    Time0In();
    //Time0_over();
    while (1)
    {
    if(Tcount==20)
	{
    P1^=0xff;
	Tcount=0; 
	}
    if(Tcount==10)
	{
	P2^=0xff;
	}
	if(Tcount==5)
	{
	P3^=0xff;
	}
	}
    
}

